package com.mycompany.share.service;

import com.mycompany.share.data.ShareData;
import com.mycompany.share.entity.ShareEntity;
import java.util.ArrayList;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
//import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("link")
public class ShareService {
	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public ArrayList<ShareEntity> getAllLinks() {
		ArrayList<ShareEntity> links = ShareData.findAllLinks();
		return links;
	}
	
	@GET
	@Path("{id}")
	@Produces(MediaType.APPLICATION_JSON)
	public ArrayList<ShareEntity> getLinkById(@PathParam("id") long id) {
		ArrayList<ShareEntity> link = ShareData.findLinkById(id);
		return link;
	}
	
	@PUT
	@Consumes(MediaType.APPLICATION_JSON)
	public void updateLinkById() {
		ShareData update = new ShareData();
		update.updateLinkById(null);
	}
	
	
}
